package com.whmnx.shop.ui.viewmodel;

import android.app.Application;

import androidx.annotation.NonNull;

import com.whmnx.shop.ui.fragment.ShopDetailsFragment;
import com.whmnx.shop.ui.view.SelectParamPopupWindow;
import com.whmnx.shop.ui.view.SelectPopUtil;

import me.goldze.mvvmhabit.binding.command.BindingAction;
import me.goldze.mvvmhabit.binding.command.BindingCommand;

/**
 * author : huang
 * date   : 2020/9/23 0023 14:50
 * version: 1.0
 * @author Administrator
 */
public class ShopDetailsModel extends ToolbarViewModel{
    private ShopDetailsFragment activity;

    public ShopDetailsModel(@NonNull Application application) {
        super(application);
    }


    public void initToolbar(ShopDetailsFragment activity) {
        setTitleText("商品详情");
        this.activity = activity;
    }

    //加入购物车
    public BindingCommand addShopOnClickCommand = new BindingCommand(new BindingAction() {
        @Override
        public void call() {
            SelectPopUtil.showSpec(activity.getActivity(),null,null,0, new SelectParamPopupWindow.OnCancelListener() {
                @Override
                public void onCancel() {

                }

                @Override
                public void onAddCar(String goodsId, String priceId, int count) {

                }
            });
        }
    });


    //立即购买
    public BindingCommand lijiOnClickCommand = new BindingCommand(new BindingAction() {
        @Override
        public void call() {
          //  startContainerActivity(ConfirmOrderFragment.class.getCanonicalName());
        }
    });
}
